import React from "react";
import { View, Button, Text, Image } from "@moyoko/components";
import "./app.css";

export default class Test extends React.Component {
  state = {
    name: 1,
  };
  onShareAppMessage() {
    console.log("onShareAppMessage");
    return {
      img: "",
      title: "a1",
    };
  }
  //onShareTimeline() {}
  onLoad() {
    console.log("2222");
  }
  setData() {
    this.setState({
      name: this.state.name + 1,
    });
  }
  render() {
    return (
      <View
        className="page"
        onClick={(event) => {
          console.log("addd1");
          this.setData();
          ////  ++xi;
        }}
      >
        <View className="i_center">
          <Image style={{ borderRadius: "10px 20px", width: "80PX" }} mode="widthFix" src="static/2021080400d11775-521f-1775521f-8692-28e5ec311d12-W132H132" />
        </View>
        自增数字： {this.state.name}
        <Button
          className="button"
          onClick={(event) => {
            console.log("Button");
          }}
        >
          <Text>hello，world</Text>
        </Button>
        <Button
          className="button"
          onClick={(event) => {
            event.stopPropagation();
            console.log("Button");
          }}
        >
          <Text>阻止事件冒泡</Text>
        </Button>
      </View>
    );
  }
}
